function [Cf, error]=matchableC(Cin)
C=[0.47e-6, 1e-9, 1e-12, 1e-6, 1.2e-9, 1.2e-12, 1.5e-9, 1.5e-12, 1.8e-9, 1.8e-12, 10e-9, 10e-12, 10e-6, 100e-9, 100e-12, 100e-6, 1000e-12, 1000e-6, 12e-9, 12e-12, 120e-9, 120e-12, 15e-9, 150e-9, 150e-12, 18e-9, 18e-12, 180e-9, 180e-12, 2.2e-9, 2.2e-12, 2.2e-6, 2.7e-9, 2.7e-12, 22e-9, 22e-12, 22e-6, 220e-9, 220e-12, 220e-6, 2200e-6, 27e-9, 27e-12, 270e-9, 270e-12, 3.3e-9, 3.3e-12, 3.3e-6, 3.9e-9, 3.9e-12, 33e-9, 33e-12, 33e-6, 330e-9, 330e-12, 330e-6, 3300e-6, 39e-9, 39e-12, 390e-9, 390e-12, 4.7e-9, 4.7e-12, 4.7e-6, 47e-9, 47e-12, 47e-6, 470e-9, 470e-12, 470e-6, 4700e-6, 5.6e-9, 5.6e-12, 56e-9, 56e-12, 560e-9, 560e-12, 6.8e-9, 6.8e-12, 680e-9, 680e-12, 8.2e-9, 8.2e-12, 82e-9, 82e-12, 820e-12];
Cf=[0,0,0];
% Componente Solo
for x=1:length(Cin)
    error(x)=1;
    for t=1:length(C)
        if Cin(x)==C(t)
            Cf(x,1)=Cin(x);
            Cf(x,2)=0;
            Cf(x,3)=3;
            error(x)=0;
            break;
        end
    end
end
       
% Paralelo
for x=1:length(Cin)
    for t=1:length(C)
        for j=t:length(C)
              Cp=C(t)+C(j);
              if Cp>=0.5*Cin(x) && Cp<=1.5*Cin(x)
                errorSample=abs(Cin(x)-Cp)/Cin(x);
                if errorSample<error(x)
                    Cf(x,1)=C(t);
                    Cf(x,2)=C(j);
                    Cf(x,3)=1; % 0 significa paralelo
                    error(x)=errorSample;
                end
              end
        end
    end
end

% Serie
for x=1:length(Cin)
    for t=1:length(C)
        for j=t:length(C)
            Cs=C(t)*C(j)/(C(t)+C(j));
            if Cs>=0.5*Cin(x) && Cs<=1.5*Cin(x)
                errorSample=abs(Cin(x)-Cs)/Cin(x);
                if errorSample<error(x)
                    Cf(x,1)=C(t);
                    Cf(x,2)=C(j);
                    Cf(x,3)=0; % 1 significa serie
                    error(x)=errorSample;
                end
            end
        end
    end
end



error=100*error;
end